from flask import Flask,redirect
from views import html,user,article
from settings import static_config

app=Flask(__name__,**static_config)

app.register_blueprint(html,url_prefix='/html')#^注册页面子路由
app.register_blueprint(user,url_prefix='/user')#^注册用户子路由
app.register_blueprint(article,url_prefix='/article')#^注册文章子路由

@app.errorhandler(404)#^错误页面重定向
def _(_):
    return redirect('/html/index')

@app.route("/", methods=['GET',"POST"])#^默认页面
def _():
    return redirect('/html/index')
